package packet1;

import java.util.*;
public class xiec1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] nums = new int[n];
        for (int i = 0; i < n; i++) {
           nums[i] = sc.nextInt();
        }
        int[] ans = find(nums);
        if(ans[1] == 0){
            nums[0] = nums[1];
            System.out.println(find(nums)[0]);
            return;
        }
        if(ans[1] == n - 2){
            nums[n - 1] = nums[n - 2];
            System.out.println(find(nums)[0]);
            return;
        }
        nums[ans[1]] = (nums[ans[1] + 1] + nums[ans[1] - 1]) / 2;
        System.out.println(find(nums)[0]);
    }
    public static int[] find(int[] nums){
        int[] ans = new int[2];
        ans[0] = -1;
        ans[1] = -1;
        int n = nums.length;
        for (int i = 0; i < n - 1; i++) {
            int abs = Math.abs(nums[i + 1] - nums[i]);
            if(abs > ans[0]){
                ans[0] = abs;
                if(nums[i] > nums[i + 1])
                    ans[1] = i + 1;
                else ans[1] = i;
            }
        }
        return ans;
    }
}
/*
3
1 3 4

5
-1 1 2 5 7
 */